/*
 * @Author: zhangwei 1405298045@qq.com
 * @Date: 2022-02-22 10:50:03
 * @LastEditTime: 2022-02-22 11:13:12
 * @LastEditors: zhangwei 1405298045@qq.com
 * @Description:
 * @FilePath: /ll-fe-mp-dyfx/src/config/index.js
 *
 */
const { NODE_ENV, VUE_APP_LL_ENV } = process.env;

const modulesFiles = require.context('./modules', true, /\.js$/);

const modules = modulesFiles.keys().reduce((modules, modulePath) => {
	const moduleName = modulePath.replace(/^\.\/(.*)\.\w+$/, '$1');

	const { default: formatValue } = modulesFiles(modulePath);

	modules[moduleName] = formatValue;

	return modules;
}, {});

export default modules[VUE_APP_LL_ENV || NODE_ENV];
